import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;


public class main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		Document doc = Jsoup.connect("http://www.rixen-seilbahnen.de/deutsch/referenzen/europa/europa.html").get();
		String title = doc.title();
		System.out.println(title);

		Element table = doc.getElementsByClass("referenzen").first();
		
		for(Element tabrow : table.select("tr")){
			System.out.println("---------");
		
			tabrow.select("br").remove();

			for(int i = 0; i<3; i++){
				
				
				if(i==0){
					String location = tabrow.select("td").get(i).text();
					System.out.println("Ort: "+ location);
				}
				else if (i==1) {
					Element tabrow2 = tabrow.clone();
					tabrow2.select("a").remove();
					
					String contact = tabrow2.select("td").get(i).text();
					String website = tabrow.select("td").get(i).select("a").first().attr("href");
					
					System.out.println("Kontakt: "+ contact);
					System.out.println("Website: "+ website);
				}
				else if (i == 2) {
					String image = "";
					if(tabrow.select("td").get(i).children().first() != null)
						image = tabrow.select("td").get(i).children().first().attr("abs:src");
					System.out.println("Bild: "+ image);
					
				}
			}
		}
	}
}
